<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript" src="../../mofumui/mofumui.js" ></script>
	</head>
	<body>
		<script type="text/javascript">
			//设置JS路由
			mofum.setPrefix("../../");
			mofum.imports(["MFrame","MMenuBar"],function(MFrame,MMenuBar){
				
				//创建框架
				var frame = new MFrame();
				
				//菜单栏
				var menubar = new MMenuBar().setHeight(30).setBackground("#666").setFontColor("#fff").setFontSize(12);
				
				//一级菜单
				var levelOneMenu = ["文件","测试","内容"];
				menubar.addMenus(levelOneMenu);
				
				//批量设置菜单
				menubar.setMenus(function(menu){
					menu.setFontColor("#fff");
				});
				
				//二级菜单
				var levelTwoMenu = ["新建","保存","打开"];
				
				//文件菜单
				var fileMenu = menubar.getMenu(0);
				fileMenu.addMenuItems(levelTwoMenu);
				
				//批量设置菜单项
				fileMenu.setMenuItems(function(item){
					item.setBackground("#AAA");
					item.setFontColor("#fff")
				});
				
				//三级菜单跟二级菜单类似
				frame.append(menubar);
				
			});
			
		</script>
	</body>
</html>
